smartbuck6 2.2.0
Loading...
Searching...
No Matches
Smart Buck 6 Click Driver

API for configuring and manipulating Smart Buck 6 Click driver. More...

Topics

 Smart Buck 6 Registers List
 List of registers of Smart Buck 6 Click driver.
 Smart Buck 6 Registers Settings
 Settings for registers of Smart Buck 6 Click driver.
 Smart Buck 6 MikroBUS Map
 MikroBUS pin mapping of Smart Buck 6 Click driver.

Functions

void smartbuck6_cfg_setup (smartbuck6_cfg_t *cfg)
 Smart Buck 6 configuration object setup function.
err_t smartbuck6_init (smartbuck6_t *ctx, smartbuck6_cfg_t *cfg)
 Smart Buck 6 initialization function.
err_t smartbuck6_default_cfg (smartbuck6_t *ctx)
 Smart Buck 6 default configuration function.
err_t smartbuck6_write_reg (smartbuck6_t *ctx, uint8_t reg, uint8_t data_in)
 Smart Buck 6 write register function.
err_t smartbuck6_read_reg (smartbuck6_t *ctx, uint8_t reg, uint8_t *data_out)
 Smart Buck 6 read register function.
void smartbuck6_enable_device (smartbuck6_t *ctx)
 Smart Buck 6 enable device function.
void smartbuck6_disable_device (smartbuck6_t *ctx)
 Smart Buck 6 disable device function.
uint8_t smartbuck6_get_pg_pin (smartbuck6_t *ctx)
 Smart Buck 6 get power-good pin function.
err_t smartbuck6_check_com (smartbuck6_t *ctx)
 Smart Buck 6 check communication function.
err_t smartbuck6_read_status (smartbuck6_t *ctx, smartbuck6_status_t *status)
 Smart Buck 6 read status registers function.
err_t smartbuck6_clear_status (smartbuck6_t *ctx)
 Smart Buck 6 clear status flags function.
err_t smartbuck6_enable_buck (smartbuck6_t *ctx, uint8_t buck_sel)
 Smart Buck 6 enable selected buck function.
err_t smartbuck6_disable_buck (smartbuck6_t *ctx, uint8_t buck_sel)
 Smart Buck 6 disable selected buck function.
err_t smartbuck6_set_buck_vout (smartbuck6_t *ctx, uint8_t buck_sel, uint16_t vout_mv)
 Smart Buck 6 set output voltage function.
err_t smartbuck6_read_buck_current (smartbuck6_t *ctx, uint8_t buck_sel, uint16_t *current_ma)
 Smart Buck 6 read buck output current function.

Detailed Description

API for configuring and manipulating Smart Buck 6 Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ smartbuck6_cfg_setup()

void smartbuck6_cfg_setup ( smartbuck6_cfg_t * cfg)

Smart Buck 6 configuration object setup function.

This function initializes Click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See smartbuck6_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ smartbuck6_check_com()

err_t smartbuck6_check_com ( smartbuck6_t * ctx)

Smart Buck 6 check communication function.

This function checks communication by reading and verifying the PART ID register.

Parameters
[in]ctx: Click context object. See smartbuck6_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
Note
None.

◆ smartbuck6_clear_status()

err_t smartbuck6_clear_status ( smartbuck6_t * ctx)

Smart Buck 6 clear status flags function.

This function clears global and buck-specific overcurrent status flags.

Parameters
[in]ctx: Click context object. See smartbuck6_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
Note
None.

◆ smartbuck6_default_cfg()

err_t smartbuck6_default_cfg ( smartbuck6_t * ctx)

Smart Buck 6 default configuration function.

This function executes a default configuration of Smart Buck 6 Click board.

Parameters
[in]ctx: Click context object. See smartbuck6_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ smartbuck6_disable_buck()

err_t smartbuck6_disable_buck ( smartbuck6_t * ctx,
uint8_t buck_sel )

Smart Buck 6 disable selected buck function.

This function disables one or more buck regulators by clearing their control bits.

Parameters
[in]ctx: Click context object. See smartbuck6_t object definition for detailed explanation.
[in]buck_sel: Buck regulator selection mask (e.g. SMARTBUCK6_BUCK_A, BUCK_B, BUCK_C, BUCK_ALL).
Returns
  • 0 - Success,
  • -1 - Error.
Note
None.

◆ smartbuck6_disable_device()

void smartbuck6_disable_device ( smartbuck6_t * ctx)

Smart Buck 6 disable device function.

This function sets the ON pin to logic high state to disable the device.

Parameters
[in]ctx: Click context object. See smartbuck6_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ smartbuck6_enable_buck()

err_t smartbuck6_enable_buck ( smartbuck6_t * ctx,
uint8_t buck_sel )

Smart Buck 6 enable selected buck function.

This function enables one or more buck regulators by setting their control bits.

Parameters
[in]ctx: Click context object. See smartbuck6_t object definition for detailed explanation.
[in]buck_sel: Buck regulator selection mask (e.g. SMARTBUCK6_BUCK_A, BUCK_B, BUCK_C, BUCK_ALL).
Returns
  • 0 - Success,
  • -1 - Error.
Note
None.

◆ smartbuck6_enable_device()

void smartbuck6_enable_device ( smartbuck6_t * ctx)

Smart Buck 6 enable device function.

This function sets the ON pin to logic low state to enable the device.

Parameters
[in]ctx: Click context object. See smartbuck6_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ smartbuck6_get_pg_pin()

uint8_t smartbuck6_get_pg_pin ( smartbuck6_t * ctx)

Smart Buck 6 get power-good pin function.

This function reads the logic level of the PG pin.

Parameters
[in]ctx: Click context object. See smartbuck6_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ smartbuck6_init()

err_t smartbuck6_init ( smartbuck6_t * ctx,
smartbuck6_cfg_t * cfg )

Smart Buck 6 initialization function.

This function initializes all necessary pins and peripherals used for this Click board.

Parameters
[out]ctx: Click context object. See smartbuck6_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See smartbuck6_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ smartbuck6_read_buck_current()

err_t smartbuck6_read_buck_current ( smartbuck6_t * ctx,
uint8_t buck_sel,
uint16_t * current_ma )

Smart Buck 6 read buck output current function.

This function reads and returns the output current of the selected buck regulator.

Parameters
[in]ctx: Click context object. See smartbuck6_t object definition for detailed explanation.
[in]buck_sel: Buck regulator selection (only one buck should be selected).
[out]current_ma: Pointer to store output current in milliamps.
Returns
  • 0 - Success,
  • -1 - Error.
Note
None.

◆ smartbuck6_read_reg()

err_t smartbuck6_read_reg ( smartbuck6_t * ctx,
uint8_t reg,
uint8_t * data_out )

Smart Buck 6 read register function.

This function reads a single byte of data from the specified register address.

Parameters
[in]ctx: Click context object. See smartbuck6_t object definition for detailed explanation.
[in]reg: Register address.
[out]data_out: Pointer to memory where read data will be stored.
Returns
  • 0 - Success,
  • -1 - Error.
Note
None.

◆ smartbuck6_read_status()

err_t smartbuck6_read_status ( smartbuck6_t * ctx,
smartbuck6_status_t * status )

Smart Buck 6 read status registers function.

This function reads the STATUS_0, STATUS_1, and OC_STATUS registers and stores them in the status structure.

Parameters
[in]ctx: Click context object. See smartbuck6_t object definition for detailed explanation.
[out]status: Pointer to status structure. See smartbuck6_status_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
Note
None.

◆ smartbuck6_set_buck_vout()

err_t smartbuck6_set_buck_vout ( smartbuck6_t * ctx,
uint8_t buck_sel,
uint16_t vout_mv )

Smart Buck 6 set output voltage function.

This function sets the output voltage for one or more buck regulators. It automatically adjusts the voltage range selection and applies reconfiguration if needed.

Parameters
[in]ctx: Click context object. See smartbuck6_t object definition for detailed explanation.
[in]buck_sel: Buck regulator selection mask.
[in]vout_mv: Output voltage in millivolts.
Returns
  • 0 - Success,
  • -1 - Error.
Note
Reconfiguration includes disabling and re-enabling the regulator.

◆ smartbuck6_write_reg()

err_t smartbuck6_write_reg ( smartbuck6_t * ctx,
uint8_t reg,
uint8_t data_in )

Smart Buck 6 write register function.

This function writes a single byte of data to the specified register address.

Parameters
[in]ctx: Click context object. See smartbuck6_t object definition for detailed explanation.
[in]reg: Register address.
[in]data_in: Data byte to be written.
Returns
  • 0 - Success,
  • -1 - Error.
Note
None.